Python 3.11.0 | packaged by conda-forge | (main, Jan 16 2023, 14:12:30) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.

Restarted magpy_env

In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'MegaRuns', 'testPArunMega3')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=True)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()

#---------------------------------------------------
#* Plotting 2 body decay rate
dfs = [df for df in groups.values()]

for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={df.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 211/211 [00:04<00:00, 48.31it/s]
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'MegaRuns', 'testPArunMega4')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=False)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()

#---------------------------------------------------
#* Plotting 2 body decay rate
dfs = [df for df in groups.values()]

for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={df.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 209/209 [06:52<00:00,  1.97s/it]
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'MegaRuns', 'testPArunMega5')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=False)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()

#---------------------------------------------------
#* Plotting 2 body decay rate
dfs = [df for df in groups.values()]

for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={df.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 209/209 [04:45<00:00,  1.36s/it]
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'MegaRuns', 'testPArunMega6')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=True)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()

#---------------------------------------------------
#* Plotting 2 body decay rate
dfs = [df for df in groups.values()]

for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={df.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 209/209 [00:04<00:00, 46.82it/s]
In [ ]:
folders = [os.path.join(EXP_FOLDER, 'MegaRuns', path ) for path in ['testPArunMega3', 'testPArunMega4', 'testPArunMega5', 'testPArunMega6']]

dfs_mega = [get_data_frame(measure_folder, cache_all=True) for measure_folder in folders]

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

dfs_grouped = [df_mega.groupby(by=groupbyKey) for df_mega in dfs_mega]
min_ratios = [df_grouped['ratio'].min() for df_grouped in dfs_grouped]

groupss = [dict(list(df_grouped)) for df_grouped in dfs_grouped]
dfs = [ [df for df in groups.values()] for groups in groupss]

for row in dfs:
    data = row[0]
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][titleKey]:.2f}")
plt.legend()
    
100%|██████████| 211/211 [00:04<00:00, 44.05it/s]
100%|██████████| 211/211 [00:03<00:00, 67.41it/s]
100%|██████████| 211/211 [00:03<00:00, 69.15it/s]
100%|██████████| 210/210 [00:03<00:00, 69.97it/s] 
Out[ ]:
<matplotlib.legend.Legend at 0x2b37d8d40d0>
In [ ]:
for row in dfs:
    data = row[1]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b37b6893d0>
In [ ]:
for row in dfs:
    data = row[2]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b3038a72d0>
In [ ]:
for row in dfs:
    data = row[3]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b37ec6b350>
In [ ]:
for row in dfs:
    data = row[4]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b3033f72d0>
In [ ]:
folders = [os.path.join(EXP_FOLDER, 'MegaRuns', path ) for path in ['testPArunMega7', 'testPArunMega8']]

dfs_mega = [get_data_frame(measure_folder, cache_all=True) for measure_folder in folders]

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

dfs_grouped = [df_mega.groupby(by=groupbyKey) for df_mega in dfs_mega]
min_ratios = [df_grouped['ratio'].min() for df_grouped in dfs_grouped]

groupss = [dict(list(df_grouped)) for df_grouped in dfs_grouped]
dfs = [ [df for df in groups.values()] for groups in groupss]
100%|██████████| 209/209 [00:03<00:00, 65.50it/s]
100%|██████████| 209/209 [00:03<00:00, 60.49it/s]
In [ ]:
for row in dfs:
    data = row[0]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b3033a8490>
In [ ]:
for row in dfs:
    data = row[-1]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b37ec3f2d0>
In [ ]:
for row in dfs:
    data = row[1]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b3093c4150>
In [ ]:
for row in dfs:
    data = row[2]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b303cef2d0>
In [ ]:
for row in dfs:
    data = row[3]
    
    freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{titleKey}={data.iloc[10][titleKey]:.2f}")
    plt.title(f'{groupbyKey} = {data.iloc[10][groupbyKey]:.2f}')
plt.legend()
    
Out[ ]:
<matplotlib.legend.Legend at 0x2b30142b350>
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'PArunHalfVarDet1')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=True)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_AOM_freq'
titleKey = 'pump_reference'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()
100%|██████████| 104/104 [00:03<00:00, 33.60it/s]
In [ ]:
for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'PArunHalfVarDet1')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=True)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_AOM_freq'
titleKey = 'pump_reference'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()][:-1]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()

for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 105/105 [00:02<00:00, 36.42it/s]
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'PAHalfRunVarPumpAmpl1')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=True)
dfc= df.copy()
#df.dropna(inplace=True)

groupbyKey = 'pump_AOM_freq'
titleKey = 'pump_reference'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()][:-1]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
x = [df[groupbyKey].mean() for df in dfs]
y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
plt.plot( x, y ,'-o')
plt.xlabel(groupbyKey)
plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
plt.show()
plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
plt.close()

for i, df  in enumerate(dfs[:]):
        data = df
        freqs = ((384182.5-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
        betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
        freqs = sorted(freqs)
        plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 104/104 [00:03<00:00, 31.60it/s]